package cn.codeforfun.mq;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;


/**
 * Created by Administrator on 2017/2/26.
 */
@Component
public class Sender {

  @Autowired
  private AmqpTemplate amqpTemplate;

  /**
   * exchange:交换机名称
   * routingKey:路由关键字
   * object:发送的消息内容
   * correlationData:消息ID
   */
  public void send(String content) {
    amqpTemplate.convertAndSend("amqpTestQueue", content);
  }
}
